﻿namespace Dcms.BLL
{
    using Dcms.IDAL;
    using Dcms.Model;
    using System;
    using System.Collections.Generic;

    public class Dcms_PermissionBLL
    {
        private Dcms_PermissionModel PermM = new Dcms_PermissionModel();
        private IDcms_PermissionDAL permOp = Dcms.DALFactory.DALFactory.CreateDcms_Permission();

        public Dcms_PermissionModel AddModel(Dcms_PermissionModel model)
        {
            return this.permOp.AddModel(model);
        }

        public IList<Dcms_PermissionModel> DDLPermissionData()
        {
            return this.permOp.GetDataListByPage();
        }

        public void DeleteModelByID(int ID)
        {
            this.permOp.DeleteModelByID(ID);
        }

        public string GetDataCount(string SqlStr)
        {
            return this.permOp.GetDataCount(SqlStr);
        }

        public IList<Dcms_PermissionModel> GetDataListByPage(string SqlStr, int CurPage, int PageSize)
        {
            return this.permOp.GetDataListByPage(SqlStr, CurPage, PageSize);
        }

        public int GetMaxModelKeyID(string strPermission_Flag)
        {
            return this.permOp.GetMaxModelKeyID(strPermission_Flag);
        }

        public Dcms_PermissionModel GetModelByID(int ID)
        {
            return this.permOp.GetModelByID(ID);
        }

        public IList<Dcms_PermissionModel> GetModelList()
        {
            return this.permOp.GetModelList(0);
        }

        public int GetPermissionIdByFlag(string Flag)
        {
            return this.permOp.GetPermissionIdByFlag(Flag);
        }

        public IList<Dcms_PermissionModel> GetUserPermissionModel(int ParentID)
        {
            return this.permOp.GetUserPermissionModel(ParentID);
        }

        public IList<Dcms_PermissionModel> GetUserPermissionModelByRoleId(int ParentID, string pIdstr)
        {
            return this.permOp.GetUserPermissionModelByRoleId(ParentID, pIdstr);
        }

        public Dcms_PermissionModel Update(Dcms_PermissionModel model)
        {
            return this.permOp.Update(model);
        }
    }
}

